﻿<html>
  <head>
  <title></title>
  <style> 
    richtext { 
      behavior:richtext; 
      size:*; border:1px solid blue; 
      overflow:auto;
    }
  </style>
  <script type="text/tiscript">
   
    const HTML_FILES = "HTML Files (*.htm,*.html)|*.HTM;*.HTML|All Files (*.*)|*.*";

    event click $(#load) {
      var fn = view.selectFile(#load, HTML_FILES , "html" );
      if( fn ) $(richtext).richtext.load(fn);
    }

    event click $(#load-from-string) {
       $(richtext).richtext.load("<p>Привет,мир!</p>","about:blank");
    }

    
    event click $(#save) {
      var fn = view.selectFile(#save, HTML_FILES , "html", "rtext.htm", "‘File name:");
      if( fn ) $(richtext).richtext.save(fn);
    }
    
  </script>
  </head>
<body>
  <button #load>Load</button>
  <button #save>Save</button>
  <button #load-from-string>Load from String</button>
  <richtext src="test-doc.htm" spellcheck="true"/>


</body>
</html>
